Skip to content

id: add append admission state machine - #12932

Merged
dezren39 merged 1 commit into
mainfrom
codex/21115-append-admission
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
codex/21115-append-admission

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Refs #10237

Summary

  • add the append-list submission vocabulary and graph module wiring
  • add the id-events admission state machine for signature-first validation, Pending/direct acceptance, approval CAS rechecks, revocation, idempotency conflicts, and stable order
  • add the independent model-based state-machine integration test and register its suite

Evidence

Merge Danger

Low-to-medium. This is the approved append-admission slice; it leaves tenant/membership authority as policy input and does not perform production rollout.


Prove it works
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 23, 2026 05:17
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 14 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dbd079e1-c843-44b6-ae37-512a8daf6791
Commits

Reviewing files that changed from the base of the PR and between 808d00f and 0fdb12e.

Files selected for processing: 6

  • .github/test-suite-registry.json
  • pkgs/id/crates/id-core/src/graph/append_list.rs
  • pkgs/id/crates/id-core/src/graph/mod.rs
  • pkgs/id/crates/id-events/src/graph_admission.rs
  • pkgs/id/crates/id-events/src/lib.rs
  • pkgs/id/crates/id-events/tests/append_list_state_machine.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T05:20:10.546977Z 0fdb12e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39
dezren39 merged commit b25daaf into main Nov 23, 2026
2 checks passed
@dezren39
dezren39 deleted the codex/21115-append-admission branch November 23, 2026 05:19

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0fdb12e9e3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

return false;
}
match policy.rule {
AdmissionRule::OwnerOnly => policy.admins.contains(signer),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Distinguish the owner from group administrators

With AdmissionRule::OwnerOnly, any signer in policy.admins is directly accepted, exactly as with AdmissionRule::Admins. The existing enum explicitly defines OwnerOnly as accepting only the owner, so an administrator who is not the owner can bypass moderation under this policy. Carry the owner identity separately and compare against it for this rule.

Useful? React with 👍 / 👎.

Comment on lines +106 to +108
if !eligible(policy, &pending.signer) {
return Err(AdmissionError::NotEligible);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Check reviewer eligibility separately from direct admission

For a non-group submitter on an open attribute, submit correctly creates a pending item, but this check prevents anyone from approving it unless the submitter first becomes eligible for direct acceptance. AdmissionRule is documented as controlling direct acceptance, and design §6.2 permits non-group submissions through member/admin approval. Approval needs a separately authorized reviewer rather than requiring the original signer to satisfy the direct-admission rule; otherwise the advertised moderation path cannot publish external submissions.

Useful? React with 👍 / 👎.

Comment on lines +109 to +113
let pending = self
.pending
.remove(&PendingId::from(id))
.ok_or(AdmissionError::NotFound)?;
self.accepted.push(pending.id);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject approval after the attribute has been closed

If a member submits while the attribute is moderated and the owner subsequently changes its mode to Closed, approve still removes the pending item and appends it to the accepted list. This method never examines policy.mode, although it receives the current policy and promises to recheck it. Check the current append mode before committing acceptance so closing an attribute also prevents pending submissions from being appended.

Useful? React with 👍 / 👎.

Comment on lines +75 to +79
let pending = PendingId::from(submission.id.as_str());
return if self.pending.contains_key(&pending) {
Ok(AdmissionOutcome::Pending(pending))
} else {
Ok(AdmissionOutcome::Accepted)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Resolve idempotent retries using the original submission identity

When a pending submission is retried with the same idempotency key and bytes but a different id, this branch looks up the retry's ID and returns Accepted even though the original submission is still pending and nothing was accepted. AttributeSubmission exposes these fields independently, and this API neither validates their binding nor retains the original ID in the idempotency record. Store the original submission identity alongside the bytes and return its actual state, or reject inconsistent identities.

Useful? React with 👍 / 👎.

Comment on lines +1 to +6
//! Model-based oracle for A-GRAPH-9127-02 (#10237).
//!
//! The model says invalid signatures never enter either state; open attributes
//! still hold non-group submissions in Pending; approval rechecks current
//! membership and revocation; idempotency keys conflict on different bytes;
//! and accepted order is append-only.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Exercise admission transitions with a generated reference model

This suite describes itself as model-based, but all four tests are fixed examples against the implementation; there is no independent transition model or generated command sequence. The repository's testing doctrine explicitly requires PBT for state-machine invariants and MBT where a specification exists. Add a reference model and generate submit, approve, retry, and policy-change sequences, comparing results and state after each operation; the current examples do not exercise successful approval or interacting transitions.

AGENTS.md reference: AGENTS.md:L36-L39

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant